GamepadLaunch Game API
Start a game session for your users
GET
https://igamingapis.live/api/v1
This API is used to start a game session for a user. You send user info, balance, and session ID to the server, and it returns a URL to launch the game.

Note: The parameters currency_code and language are optional. Your code will work perfectly fine without passing these parameters. You can omit them if you don't need to specify currency or language.

Parameters
Parameter	Type	Required	Description	Example
user_id	string	Yes	Unique user ID in your system	23213
balance	number	Yes	User's current balance	40
game_uid	string	Yes	Unique ID for this game session	3978
token	string	Yes	Your API token	tptogkzflsbmrmolhdpebzxvkxfsbekq
timestamp	number	Yes	Current timestamp in milliseconds	1696329392000
return	string	Yes	Return URL after game closes	https://google.com/return
callback	string	Yes	Callback URL for game results	https://yourdomain.com/callback.php
currency_code	string	Optional	Currency code (e.g., BDT). Code will work without this.	BDT
language	string	Optional	Language code (e.g., bn). Code will work without this.	bn
PHP Implementation
Complete PHP Example
RevealReveal Secret
CopyCopy Code
<?php
// API credentials
$TOKEN  = '58b9261d77e0fd389a66811889dbc5ea';
$SECRET = '********************************'; // Must be 32 bytes
$SERVER_URL = 'https://igamingapis.live/api/v1';
$RETURN_URL = 'https://google.com/return';
$CALLBACK_URL = 'https://yourdomain.com/callback.php';

// Data to send
$PAYLOAD = [
    'user_id' => '23213',
    'balance' => '40',
    'game_uid' => '3978',
    'token' => $TOKEN,
    'timestamp' => round(microtime(true) * 1000),
    'return' => $RETURN_URL,
    'callback' => $CALLBACK_URL
    // Optional parameters (can be omitted - code will work without them):
    // 'currency_code' => 'BDT',  // Optional: Currency code
    // 'language' => 'bn'         // Optional: Language code
];

// Encryption function using AES-256-ECB
function ENCRYPT_PAYLOAD_ECB(array $DATA, string $KEY): string {
    $JSON = json_encode($DATA);
    $ENC  = openssl_encrypt($JSON, 'AES-256-ECB', $KEY, OPENSSL_RAW_DATA);
    return base64_encode($ENC);
}

// Encrypt payload
$ENCRYPTED = ENCRYPT_PAYLOAD_ECB($PAYLOAD, $SECRET);

// Prepare full URL with payload and token
$URL = $SERVER_URL . '?payload=' . urlencode($ENCRYPTED) . '&token=' . urlencode($TOKEN);

// Send request to API
$response = file_get_contents($URL);

// Show API response
print_r(json_decode($response, true));
?>
Response Example
Success Response
{
  "code": 0,
  "msg": "Game launched successfully",
  "data": {
    "url": "https://igamingapis.live/launch?de=abcdef12345&game_name=Sweet+Magic"
  }
}